const fs=require('fs');
const zlib=require('zlib');
fs.createReadStream('test.txt.gz')
    .pipe(zlib.createGunzip())
    .pipe(fs.createWriteStream('test.txt'));
console.log('decompressed');
